package hushi.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 视图解析器配置在springmvc.xml里面
 */
@org.springframework.stereotype.Controller
@RequestMapping("user")
public class Controller {
    @GetMapping("list")
    public String doList(){
//        return "list.jsp"; //直接用文件名就找不到，要用全路径
        return "/WEB-INF/page/edit.jsp";
    }
    @GetMapping("edit")
    public String doEdit(){
        return "/WEB-INF/page/edit.jsp";
    }

    /**
     *使用InternalResourceViewResolver给相同路径设置前缀或后缀，使用简短的路径
     */
    @GetMapping("list1")
    public String doList1(){
        return "list";
    }
    @GetMapping("edit1")
    public String doEdit1(){
        return "edit";
    }
}
